package view.Etudiants.Accueil;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import view.Fenetre;

public class AccueilPage {

	private UpPanel up;
	private CenterPanel center;
	private DownPanel down;

	public AccueilPage() {

		// Agencement des conteneurs
		GridBagConstraints constraint = new GridBagConstraints();
		Fenetre.fen.setLayout(new GridBagLayout());

		// Creation des conteneurs
		up = new UpPanel();				// Panneau de titre
		center = new CenterPanel();		// Panneau de choix
		down = new DownPanel();			// Panneau vide pour placer le bouton


		// CONTRAINTE DU PANNEAU DE TITRE

		constraint.gridx = 1;
		constraint.gridy = 0;

		constraint.weightx = 1.0;
		constraint.weighty = GridBagConstraints.NONE;

		constraint.gridwidth = GridBagConstraints.REMAINDER;
		constraint.gridheight = 5;

		constraint.fill = GridBagConstraints.BOTH;

		Fenetre.fen.add(up, constraint);


		// CONTRAINTE DU PANNEAU DE CHOIX

		constraint.gridy = 5;

		constraint.weighty = 0.9;

		constraint.gridheight = 90;

		constraint.fill = GridBagConstraints.BOTH;

		Fenetre.fen.add(center, constraint);


		// CONTRAINTE DU PANNEAU VIDE

		constraint.gridy = 95;

		constraint.weighty = GridBagConstraints.NONE;

		constraint.gridheight = 5;

		constraint.fill = GridBagConstraints.BOTH;

		Fenetre.fen.add(down, constraint);

		// FIN DES CONTRAINTES


		// Mise a jour de la fenetre
		Fenetre.fen.validate();

	}

	/**Vide la fenetre etudiant.**/
	public void erase() {

		Fenetre.fen.remove(up);
		Fenetre.fen.remove(center);
		Fenetre.fen.remove(down);

		Fenetre.fen.validate();

	}

}
